package com.ruoyi.finances.service.impl;

import java.util.Collections;
import java.util.List;

import com.ruoyi.finances.domain.TbSubject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.finances.mapper.TbAccountCashMapper;
import com.ruoyi.finances.domain.TbAccountCash;
import com.ruoyi.finances.service.ITbAccountCashService;

/**
 * 现金账户Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-14
 */
@Service
public class TbAccountCashServiceImpl implements ITbAccountCashService
{
    @Autowired
    private TbAccountCashMapper tbAccountCashMapper;

    /**
     * 查询现金账户
     *
     * @param id 现金账户主键
     * @return 现金账户
     */
    @Override
    public TbAccountCash selectTbAccountCashById(Long id)
    {
        return tbAccountCashMapper.selectTbAccountCashById(id);
    }

    /**
     * 查询现金账户列表
     *
     * @param tbAccountCash 现金账户
     * @return 现金账户
     */
    @Override
    public List<TbAccountCash> selectTbAccountCashList(TbAccountCash tbAccountCash)
    {
        return tbAccountCashMapper.selectTbAccountCashList(tbAccountCash);
    }

    /**
     * 新增现金账户
     *
     * @param tbAccountCash 现金账户
     * @return 结果
     */
    @Override
    public int insertTbAccountCash(TbAccountCash tbAccountCash)
    {
        return tbAccountCashMapper.insertTbAccountCash(tbAccountCash);
    }

    /**
     * 修改现金账户
     *
     * @param tbAccountCash 现金账户
     * @return 结果
     */
    @Override
    public int updateTbAccountCash(TbAccountCash tbAccountCash)
    {
        return tbAccountCashMapper.updateTbAccountCash(tbAccountCash);
    }

    /**
     * 批量删除现金账户
     *
     * @param ids 需要删除的现金账户主键
     * @return 结果
     */
    @Override
    public int deleteTbAccountCashByIds(Long[] ids)
    {
        return tbAccountCashMapper.deleteTbAccountCashByIds(ids);
    }

    /**
     * 删除现金账户信息
     *
     * @param id 现金账户主键
     * @return 结果
     */
    @Override
    public int deleteTbAccountCashById(Long id)
    {
        return tbAccountCashMapper.deleteTbAccountCashById(id);
    }


    @Override
    public List<TbSubject> subjectList(Integer id) {
        return tbAccountCashMapper.subjectList(id);
    }
}
